package com.sihai.ehr.model.biz;

import javax.persistence.*;

import com.sihai.core.BaseEntity;
import com.sihai.ehr.model.sys.ExaminePeriodEnum;

/**
 * 定量考核项目设置实体类
 * 
 * <pre>
 * 	考核项目 		打分说明 		所占比率 	考核周期 	数据输入人 	数据审核人
 * 	业绩达成率(万元) 	该说明... 	50%	每月 	张大海 		财务经理
 * </pre>
 * 
 * @author Henry
 * 
 */
@Entity
public class ExamQuanItemSet extends BaseEntity<Long> {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4468555256040073911L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;

	/** 定量考核设置ID */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "examquanset_id")
	private ExamQuanSet examQuanSet;

    /** 考核职位(冗余字段，方便按item列出未输入数据的员工列表) */
    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "duty_id")
    private Duty duty;

	/** 项目标题 */
	private String title;

	/** 项目打分说明 */
	private String remark;

	/** 项目所占用百分比 */
	private Float percentage;

	/** 考核周期类型 */
    @Enumerated(EnumType.STRING)
	private ExaminePeriodEnum periodType;

    //数据输入人员类型：1为员工，2为职务
    private int dataEntierType;
	/** 数据输入人员 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "input_employee_id")
	private EmployeeinfoWork dataEntrier;
    //数据输入职务
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "input_duty_id")
    private Duty dataEntryDuty;

    //数据审核人员类型：1为员工，2为职务
    private int dataAuditerType;
	/** 数据审核人员 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "audit_employee_id")
	private EmployeeinfoWork dataAuditer;
    //数据审核职务
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "audit_duty_id")
    private Duty dataAuditDuty;

	/** 是否删除 */
	private boolean cancel;

    public ExamQuanItemSet(){}

    public ExamQuanItemSet(Long id, String title, Float percentage, String remark, ExaminePeriodEnum periodType) {
        this.id = id;
        this.title = title;
        this.percentage = percentage;
        this.remark = remark;
        this.periodType = periodType;
    }

    @Override
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
	public ExamQuanSet getExamQuanSet() {
		return examQuanSet;
	}
	
	public void setExamQuanSet(ExamQuanSet examQuanSet) {
		this.examQuanSet = examQuanSet;
	}

    public Duty getDuty() {
        return duty;
    }

    public void setDuty(Duty duty) {
        this.duty = duty;
    }

    public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Float getPercentage() {
		return percentage;
	}

	public void setPercentage(Float percentage) {
		this.percentage = percentage;
	}

	public ExaminePeriodEnum getPeriodType() {
		return periodType;
	}

	public void setPeriodType(ExaminePeriodEnum periodType) {
		this.periodType = periodType;
	}

    public int getDataEntierType() {
        return dataEntierType;
    }

    public void setDataEntierType(int dataEntierType) {
        this.dataEntierType = dataEntierType;
    }

    public EmployeeinfoWork getDataEntrier() {
        return dataEntrier;
    }

    public void setDataEntrier(EmployeeinfoWork dataEntrier) {
        this.dataEntrier = dataEntrier;
    }

    public Duty getDataEntryDuty() {
        return dataEntryDuty;
    }

    public void setDataEntryDuty(Duty dataEntryDuty) {
        this.dataEntryDuty = dataEntryDuty;
    }

    public int getDataAuditerType() {
        return dataAuditerType;
    }

    public void setDataAuditerType(int dataAuditerType) {
        this.dataAuditerType = dataAuditerType;
    }

    public EmployeeinfoWork getDataAuditer() {
        return dataAuditer;
    }

    public void setDataAuditer(EmployeeinfoWork dataAuditer) {
        this.dataAuditer = dataAuditer;
    }

    public Duty getDataAuditDuty() {
        return dataAuditDuty;
    }

    public void setDataAuditDuty(Duty dataAuditDuty) {
        this.dataAuditDuty = dataAuditDuty;
    }

    public boolean isCancel() {
		return cancel;
	}

	public void setCancel(boolean cancel) {
		this.cancel = cancel;
	}
}
